<div class="layui-form-item w500">
	<label class="layui-form-label" style="width: 150px;float: left;margin-right: 0px">预警库存数</label>
	<div class="layui-input-block" style="float: left;margin-left: 0px;width: 300px">
		<input type="text" name="inventory.inventory_warning_count" value="${inventory.inventory_warning_count!1}" autocomplete="off" class="layui-input validnumber" onkeyup="this.value=this.value.replace(/\D/g,'')" maxlength="5"  onblur="this.value=this.value.replace(/\D/g,'')" />
	</div>
</div>


<script type="text/javascript">
	$(function(){
		$(".validnumber").blur(function(){
			var _self=$(this);
			var val=_self.val();
			if(isNaN(parseInt(val))){
				alert("您输入的不是数字");
				_self.val(1);
			}else if(parseInt(val)<1){
				alert("设定的值不能小于1");
				_self.val(1);
			}else{
				_self.val(parseInt(val));
			}
		});
	})
</script>

